package controller;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import pojo.Author;
import pojo.Book;
import pojo.Topic;
import pojo.User;

import java.util.*;

import dao.AuthorDAO;
import dao.BookDAO;
import dao.TopicDAO;
 
@Controller
public class AdminController {
	
    
    @RequestMapping("/admin")
    public String hienTrangChu(HttpServletRequest request){
    	HttpSession session = request.getSession();
    	User us = (User) session
				.getAttribute("user");
    	if(us==null)       return ("page/FrontEnd/DangNhap");
    	if(us.getIsAdmin()==0) return ("page/FrontEnd/DangNhap");
    	return "page/BackEnd/TrangChu";
    }
}